function updateClock() {
    const now = new Date();
    const hours = now.getHours();
    const minutes = now.getMinutes();
    const seconds = now.getSeconds();

    const timeString = `${padZero(hours)}:${padZero(minutes)}:${padZero(seconds)}`;

    document.getElementById('clock').innerHTML = timeString;
}

function padZero(num) {
    return num < 10 ? `0${num}` : num;
}

setInterval(updateClock, 1000);